

package ejb.ebank.entities;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.*;



/**
 * klasa reprezentujaca klienta konta bankowego
 * @author piotrek
 */

@Entity
public class BankClient implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2834371125970738065L;
	
	
	private long id;
	private Collection<Account> accounts = new ArrayList<Account>();
	private String name;
	private String surname;
	private String pesel;
	private String street;
	private String city;
	private String postCode;
	private String email;
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return this.id;
	}
	
	public void setId(long clientId) {
		this.id = clientId;
	}
	
	@OneToMany(mappedBy="bankClient")
	public Collection<Account> getAccounts() {
		return this.accounts;
	}
	
	public void setAccounts(Collection<Account> a) {
		this.accounts = a;
	}
	
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	
	public String getSurname() {
		return surname;
	}
	
	public void setSurname(String surname) {
		this.surname = surname;
	}
	

	public String getPesel() {
		return pesel;
	}
	
	public void setPesel(String pesel) {
		this.pesel = pesel;
	}
	
	
	public String getStreet() {
		return street;
	}
	
	public void setStreet(String street) {
		this.street = street;
	}
	
	
	public String getCity() {
		return city;
	}
	
	public void setCity(String city) {
		this.city = city;
	}
	
	
	public String getPostCode() {
		return postCode;
	}
	
	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}
	
	
	public String getEmail() {
		return email;
	}
	
	public void setEmail(String email) {
		this.email = email;
	}
	
}
